package com.moecollege.moecollegelib.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.moecollege.moecollegelib.base.BaseFragment;

import java.util.List;

/**
 * Created by nieyonghui on 15-7-30.
 */
public class FramePagerAdapter extends FragmentPagerAdapter {
    private List<String> mTitles;
    private List<BaseFragment> mPagers;

    public FramePagerAdapter(FragmentManager fm, List<String> titles, List<BaseFragment> pagers) {
        super(fm);
        this.mTitles = titles;
        this.mPagers = pagers;
    }

    @Override
    public Fragment getItem(int position) {
        return mPagers.get(position);
    }

    @Override
    public int getCount() {
        return mPagers.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position);
    }
}
